package com.wangtianxiang.sql.generator.loader.data;

import org.yaml.snakeyaml.Yaml;

import java.io.InputStream;
import java.util.Map;

public class YmlDataSourceLoader extends AbstractDataSourceLoader {

    private final String DATA_FILE_NAME = "dataContext.yml";
    @Override
    public Map<String, Object> load() {
        Yaml yaml = new Yaml();
        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(DATA_FILE_NAME);
        return yaml.load(inputStream);
    }
}
